<?php

/**
 * Article form base class.
 *
 * @package    sinc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormGeneratedTemplate.php 15484 2009-02-13 13:13:51Z fabien $
 */
class BaseArticleForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id_article'        => new sfWidgetFormInputHidden(),
      'code_blog'         => new sfWidgetFormPropelChoice(array('model' => 'Blog', 'add_empty' => false)),
      'titre'             => new sfWidgetFormInput(),
      'contenu'           => new sfWidgetFormInput(),
      'date_creation'     => new sfWidgetFormDateTime(),
      'date_modification' => new sfWidgetFormDateTime(),
      'auteur'            => new sfWidgetFormInput(),
    ));

    $this->setValidators(array(
      'id_article'        => new sfValidatorPropelChoice(array('model' => 'Article', 'column' => 'id_article', 'required' => false)),
      'code_blog'         => new sfValidatorPropelChoice(array('model' => 'Blog', 'column' => 'id_blog')),
      'titre'             => new sfValidatorString(array('max_length' => 100)),
      'contenu'           => new sfValidatorString(array('max_length' => 255)),
      'date_creation'     => new sfValidatorDateTime(array('required' => false)),
      'date_modification' => new sfValidatorDateTime(array('required' => false)),
      'auteur'            => new sfValidatorString(array('max_length' => 100)),
    ));

    $this->widgetSchema->setNameFormat('article[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Article';
  }


}
